home *** CD-ROM | disk | FTP | other *** search
- /***************************************************************************
- documentstyle.h - description
- -------------------
- begin : Son Nov 10 2002
- copyright : (C) 2002 by Andre Simon
- email : andre.simon1@gmx.de
- ***************************************************************************/
-
- /***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
- #ifndef DOCUMENTSTYLE_H
- #define DOCUMENTSTYLE_H
-
- #include <string>
- #include <iostream>
- #include "configurationreader.h"
- #include "elementstyle.h"
- #include "stylecolour.h"
-
- using namespace std;
-
- namespace highlight {
-
- /** maps keyword class names and the corresponding formatting information*/
- typedef map <string, ElementStyle*> KeywordStyles;
-
- /** iterator for keyword styles*/
- typedef KeywordStyles::iterator KSIterator;
-
- /** \brief Contains information about document formatting properties.
-
- * @author Andre Simon
- */
-
- class DocumentStyle
- {
- private:
- ElementStyle comment, slcomment, str, dstr,
- escapeChar, number, directive, line, symbol;
- ElementStyle defaultElem;
- StyleColour bgColour;
-
- string fontsize;
- bool fileFound;
-
- KeywordStyles keywordStyles;
-
- public:
- /** Constructor
- \param styleDefinitionPath Style definition path */
- DocumentStyle(const string & styleDefinitionPath);
- DocumentStyle();
- ~DocumentStyle();
-
- /** load sytle definition
- \param styleDefinitionFile Style definition path
- \return True if successfull */
- bool load(const string & styleDefinitionFile);
-
- /** \return class names defined in the theme file */
- vector <string> getClassNames();
-
- /** \return keyword styles */
- KeywordStyles& getKeywordStyles();
-
- /** \return Font size */
- string &getFontSize() ;
-
- /** \return Background colour*/
- StyleColour& getBgColour();
-
- /** \return Style of default (unrecognized) strings */
- ElementStyle & getDefaultStyle() ;
-
- /** \return Comment style*/
- ElementStyle & getCommentStyle() ;
-
- /** \return Single line comment style*/
- ElementStyle& getSingleLineCommentStyle() ;
-
- /** \return Keyword style*/
- ElementStyle & getKeywordStyle() ;
-
- /** \return String style*/
- ElementStyle & getStringStyle() ;
-
- /** \return Directive line string style*/
- ElementStyle & getDirectiveStringStyle() ;
-
- /** \return Escape character style*/
- ElementStyle & getEscapeCharStyle() ;
-
- /** \return Number style*/
- ElementStyle & getNumberStyle() ;
-
- /** \return Directive style*/
- ElementStyle & getDirectiveStyle() ;
-
- /** \return Type style*/
- ElementStyle & getTypeStyle() ;
-
- /** \return Line number style*/
- ElementStyle & getLineStyle() ;
-
- /** \return Bracket style*/
- ElementStyle & getSymbolStyle() ;
-
- /**
- \param className Name of keyword class
- \return keyword style of the given className
- */
- ElementStyle & getKeywordStyle(const string &className);
-
- /** \return True if language definition was found */
- bool found() const ;
- };
-
- }
-
- #endif
-